home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 4
/
Apprentice-Release4.iso
/
Source Code
/
Libraries
/
Graphic Elements 3
/
GEMisc
/
GEClearWorld.c
< prev
next >
Wrap
Text File
|
1995-03-27
|
783b
|
38 lines
/*
GEClearWorld.c
Utility to clear a Graphic Elements world of all elements for reuse
Copyright 1995 by Al Evans. All rights reserved.
3/27/95
*/
#include "GEClearWorld.h"
#include "Rects.h"
#include "GEWorldManager.h"
void ClearGEWorld(GEWorldPtr world)
{
Boolean wasActive = world->active;
Boolean wasOnWorldList = world->onWorldList;
if (wasActive)
ActivateWorld(world, false);
if (wasOnWorldList)
DeleteFromWorldList(world);
while (world->idList)
DisposeGrafElement(world, world->idList->objectID);
ClearRectList(world->activeRectList);
ClearRectList(world->safeRectList);
ClearList(world->sensorList);
RectRgn(world->clipRgn, &world->animationRect);
if (wasOnWorldList)
AddToWorldList(world);
if (wasActive)
ActivateWorld(world, true);
}